package pv.dto;

import org.json.JSONException;
import org.json.JSONObject;

import android.provider.BaseColumns;

public class CountryDTO extends AbstractDTO {
	int id;
	String name;

	public CountryDTO(int id, String name) {
		super();
		this.id = id;
		this.name = name;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public static CountryDTO converFromJSON(JSONObject jsonObject)
			throws JSONException {
		if (jsonObject == null)
			return null;
		int id = jsonObject.getInt("id");
		String name = jsonObject.getString("name");
		CountryDTO result = new CountryDTO(id, name);
		return result;
	}

}
